load("@fbcode_macros//build_defs/lib:rust_oss.bzl", "rust_oss")
load("@fbsource//tools/build_defs:rust_library.bzl", "rust_library")

oncall("sapling")

rust_library(
    name = "blob",
    srcs = glob(["src/**/*.rs"]),
    autocargo = {"cargo_toml_config": {
        "lib": {"name": "blob"},
        "package": {
            "authors": ["Meta Source Control Team <sourcecontrol-dev@meta.com>"],
            "homepage": "https://sapling-scm.com/",
            "license": "MIT",
            "name": "blob",
            "repository": "https://github.com/facebook/sapling",
        },
    }},
    named_deps = {
        "blake3-constants": "//blake3:blake3-constants-rust-nothrift",
    },
    deps = [
        "fbsource//third-party/rust:blake3",
        "fbsource//third-party/rust:sha1",
        "//common/rust/folly:iobuf",
        "//eden/scm/lib/minibytes:minibytes",
        "//eden/scm/lib/types:types",
    ] + ([] if rust_oss.is_oss_build() else [
        "fbsource//third-party/rust:bytes",
        "//common/rust/folly:iobuf",
    ]),
)
